package com.jason.designpattern.creational.factorymethod;

public class TestFactoryMethod {

	public static void main(String[] args) {
		IFactory operationFactory = new AddFactory();
		Operation oper = operationFactory.createOperation();
		oper.setNumberA(10);
		oper.setNumberB(20);
		double result = oper.getResult();
		System.out.println(result);
		
		operationFactory = new SubFactory();
		oper = operationFactory.createOperation();
		oper.setNumberA(10);
		oper.setNumberB(20);
		result = oper.getResult();
		System.out.println(result);
		
		operationFactory = new MulFactory();
		oper = operationFactory.createOperation();
		oper.setNumberA(10);
		oper.setNumberB(20);
		result = oper.getResult();
		System.out.println(result);
		
		operationFactory = new DivFactory();
		oper = operationFactory.createOperation();
		oper.setNumberA(10);
		oper.setNumberB(20);
		result = oper.getResult();
		System.out.println(result);
	}
	
}
